3.1.14 \(\int \frac {\cot (x)}{a+b \cos (x)} \, dx\) [14]

Optimal. Leaf size=54 \[ \frac {\log (1-\cos (x))}{2 (a+b)}+\frac {\log (1+\cos (x))}{2 (a-b)}-\frac {a \log (a+b \cos (x))}{a^2-b^2} \]

[Out]

1/2*ln(1-cos(x))/(a+b)+1/2*ln(cos(x)+1)/(a-b)-a*ln(a+b*cos(x))/(a^2-b^2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {2800, 815} \begin {gather*} -\frac {a \log (a+b \cos (x))}{a^2-b^2}+\frac {\log (1-\cos (x))}{2 (a+b)}+\frac {\log (\cos (x)+1)}{2 (a-b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[x]/(a + b*Cos[x]),x]

[Out]

Log[1 - Cos[x]]/(2*(a + b)) + Log[1 + Cos[x]]/(2*(a - b)) - (a*Log[a + b*Cos[x]])/(a^2 - b^2)

Rule 815

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x)^m*((f + g*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int \frac {\cot (x)}{a+b \cos (x)} \, dx &=-\text {Subst}\left (\int \frac {x}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \cos (x)\right )\\ &=-\text {Subst}\left (\int \left (\frac {1}{2 (a+b) (b-x)}+\frac {a}{(a-b) (a+b) (a+x)}-\frac {1}{2 (a-b) (b+x)}\right ) \, dx,x,b \cos (x)\right )\\ &=\frac {\log (1-\cos (x))}{2 (a+b)}+\frac {\log (1+\cos (x))}{2 (a-b)}-\frac {a \log (a+b \cos (x))}{a^2-b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 50, normalized size = 0.93 \begin {gather*} \frac {\log \left (\cos \left (\frac {x}{2}\right )\right )}{a-b}-\frac {a \log (a+b \cos (x))}{a^2-b^2}+\frac {\log \left (\sin \left (\frac {x}{2}\right )\right )}{a+b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]/(a + b*Cos[x]),x]

[Out]

Log[Cos[x/2]]/(a - b) - (a*Log[a + b*Cos[x]])/(a^2 - b^2) + Log[Sin[x/2]]/(a + b)

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 54, normalized size = 1.00

method result size
default \(-\frac {a \ln \left (a +b \cos \left (x \right )\right )}{\left (a -b \right ) \left (a +b \right )}+\frac {\ln \left (-1+\cos \left (x \right )\right )}{2 a +2 b}+\frac {\ln \left (\cos \left (x \right )+1\right )}{2 a -2 b}\) \(54\)
risch \(-\frac {i x}{a +b}-\frac {i x}{a -b}+\frac {2 i x a}{a^{2}-b^{2}}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{a +b}+\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{a -b}-\frac {a \ln \left ({\mathrm e}^{2 i x}+\frac {2 a \,{\mathrm e}^{i x}}{b}+1\right )}{a^{2}-b^{2}}\) \(101\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)/(a+b*cos(x)),x,method=_RETURNVERBOSE)

[Out]

-a/(a-b)/(a+b)*ln(a+b*cos(x))+1/(2*a+2*b)*ln(-1+cos(x))+1/(2*a-2*b)*ln(cos(x)+1)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 48, normalized size = 0.89 \begin {gather*} -\frac {a \log \left (b \cos \left (x\right ) + a\right )}{a^{2} - b^{2}} + \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a - b\right )}} + \frac {\log \left (\cos \left (x\right ) - 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+b*cos(x)),x, algorithm="maxima")

[Out]

-a*log(b*cos(x) + a)/(a^2 - b^2) + 1/2*log(cos(x) + 1)/(a - b) + 1/2*log(cos(x) - 1)/(a + b)

________________________________________________________________________________________

Fricas [A]
time = 0.45, size = 53, normalized size = 0.98 \begin {gather*} -\frac {2 \, a \log \left (-b \cos \left (x\right ) - a\right ) - {\left (a + b\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (a - b\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} - b^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+b*cos(x)),x, algorithm="fricas")

[Out]

-1/2*(2*a*log(-b*cos(x) - a) - (a + b)*log(1/2*cos(x) + 1/2) - (a - b)*log(-1/2*cos(x) + 1/2))/(a^2 - b^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot {\left (x \right )}}{a + b \cos {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+b*cos(x)),x)

[Out]

Integral(cot(x)/(a + b*cos(x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 54, normalized size = 1.00 \begin {gather*} -\frac {a b \log \left ({\left | b \cos \left (x\right ) + a \right |}\right )}{a^{2} b - b^{3}} + \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a - b\right )}} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+b*cos(x)),x, algorithm="giac")

[Out]

-a*b*log(abs(b*cos(x) + a))/(a^2*b - b^3) + 1/2*log(cos(x) + 1)/(a - b) + 1/2*log(-cos(x) + 1)/(a + b)

________________________________________________________________________________________

Mupad [B]
time = 0.50, size = 47, normalized size = 0.87 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a+b}-\frac {a\,\ln \left (a+b+a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2\right )}{a^2-b^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)/(a + b*cos(x)),x)

[Out]

log(tan(x/2))/(a + b) - (a*log(a + b + a*tan(x/2)^2 - b*tan(x/2)^2))/(a^2 - b^2)

________________________________________________________________________________________